{% load markup %}
<table class="reps">
	<tr class="head">
		<th>Representative</th>
		<th colspan="2" class="related-material">Related material</th>
	</tr>			
	<tr>			
		<td class="rep-info">
			<img src="{{ MEDIA_URL }}images/headshots/_mock5.jpg"/>
			<h4><a href="">{{ rep.full_name }}</a></h4>
			<span>{{ rep.office }}{% if rep.district %}, {{ rep.district }}{% endif %}</span>
		</td>
		<td class="related-material">
			<ul>
				<li>0 Blog posts</li>
				<li>0 Report</li>
			</ul>
		</td>
		<td>
			<ul class="rep-list-nav">
				<li class="full-profile"><a href="">View full profile</a></li>
				<li class="return-top"><a class="anchorLink" href="#top">Return to the top</a></li>
			</ul>
		</td>
	</tr>
</table>


{% load markup %}
  <h3>{{ rep.office }}{% if rep.district %}, {{ rep.district }}{% endif %}</h3>
	<a class="return-top anchorLink" href="#top">Return to top</a>
  <div class="tabbed">
    <ul class="tabs">
      <li class="first-child"><a href="#{{ rep.level }}tabs{{ forloop.counter }}-1">Reports</a></li>
      <li><a href="#{{ rep.level }}tabs{{ forloop.counter }}-2">Blog Posts</a></li>
      <li><a href="#{{ rep.level }}tabs{{ forloop.counter }}-3">Contact Info</a></li>
    </ul>
    <h4>{{ rep.full_name }}, {{ rep.party }}</h4>
    <div id="{{ rep.level }}tabs{{ forloop.counter }}-1" class="panes clearfix">
      <div class="accordion">
        {% for report in rep.reports.all %}
        <h5{% if forloop.first %} class="first-child"{% endif %}><a href="{% url report report.id %}">{{ report.title }}{% if report.subtitle %}: {{ report.subtitle }}{% endif %}</a></h5>
        <div>
          <small class="date-posted">Posted {{ report.pub_date|date }}</small>
          {{ report.synopsis|markdown }}
          <p><a href="{% url report report.id %}">View full Report &raquo;</a></p>
        </div>
        {% empty %}
        <p>There are currently no reports concerning this representative.</p>
        {% endfor %}
      </div>
    </div>
    <div id="{{ rep.level }}tabs{{ forloop.counter }}-2" class="panes">
      {% if rep.posts.active %}
      <h6>Recent Posts on {{ rep }}</h6>
      <ul>
        {% for post in rep.posts.active %}
        <li><a href="{% url blog_post post.id %}">{{ post }}</a> {{ post.pub_date|date }}</li>
        {% endfor %}
      </ul>
      {% else %}
      <p>There are currently no posts concerning this representative.</p>
      {% endif %}
      <!--<p class="action"><a href="">View full profile to browse all reports and blog posts</a></p>-->
    </div>
    <div id="{{ rep.level }}tabs{{ forloop.counter }}-3" class="panes">
      {% if rep.address %}
      <pre><address>{{ rep.address }}</address></pre>
      {% endif %}
      <ul class="contact">
        {% if rep.phone %}
        <li class="phone">P: {{ rep.phone }}</li>
        {% endif %}
        {% if rep.fax %}
        <li class="fax">F: {{ rep.fax }}</li>
        {% endif %}
        {% if rep.email %}
        <li class="email"><a href="mailto:{{ rep.email }}">{{ rep.email }}</a></li>
        {% endif %}
        {% if rep.website %}
        <li class="web"><a href="{{ rep.website }}">{{ rep.website }}</a></li>
        {% endif %}
      </ul>
    </div>
  </div><!--end .tabbed-->
